<?php

	class Transaction extends Transaction_model {

    //public $pagination = "";

		function __construct() {
			parent::__construct();
		}


	
        function getList(&$filter = array()){
            $transaction = new Transaction();
            $filter[PAGINATION_QUERY_STRING_SEGMENT] = isset($filter[PAGINATION_QUERY_STRING_SEGMENT]) && $filter[PAGINATION_QUERY_STRING_SEGMENT] ? $filter[PAGINATION_QUERY_STRING_SEGMENT] : 1;
            $transaction->addSelect();
            $transaction->addSelect('COUNT(*) count');
            $transaction->find();
            $transaction->fetchNext();
            
            //install paginantion
            
            $this->load->library('pagination');
            $this->pagination->total_rows = $transaction->count;
            $this->pagination->url = current_url();
            $this->pagination->cur_page = $filter[PAGINATION_QUERY_STRING_SEGMENT];
            $transaction->addSelect();
            $transaction->addSelect('transaction.*');
            $transaction->limit($this->pagination->first_row .", ".$this->pagination->rows_per_page);
            $transaction->find();
        
        return $transaction;
            
            
        }
        }